import os
import datetime


class MySqlConfig(object):
    SECRET_KEY = os.getenv('SECRET_KEY', '401102')
    # TODO
    SQLALCHEMY_DATABASE_URI ='mysql://127.0.0.1:3306/fwwb'
    SQLALCHEMY_ECHO = False
    SQLALCHEMY_TRACK_MODIFICATIONS = False


class TokenConfig(object):
    JWT_ACCESS_TOKEN_EXPIRES = datetime.timedelta(minutes=60)


class PytesseractConfig(object):
    TESSERACT_CMD = r'D:\Tesseract\tesseract.exe'
    ALLOWED_EXTENSIONS = {'png', 'jpg', 'jpeg', 'bmp', 'gif', 'tiff'}


class Config(MySqlConfig, TokenConfig, PytesseractConfig):
    DEBUG = True
    PORT = 5000
